package com.zlh123.controller;

import com.zlh123.commom.util.R;
import com.zlh123.entity.Student;
import com.zlh123.service.Studentservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("student")
public class StudentController {
    @Autowired
    private Studentservice studentservice;
    @GetMapping("/list")
    public R findALl() {
        List<Student> list= studentservice.list();
        return R.ok().data("students",list);
    }
}
